package top.codedance.iotp.registy.net.handle.action;

import com.alibaba.fastjson.JSONObject;
import top.codedance.iotp.registy.RegistryApplication;
import top.codedance.iotp.registy.net.handle.AdapterController;
import top.codedance.iotp.registy.util.SystemUtil;

public class HealthyController extends AdapterController {

    @Override
    public String doSubHandler(JSONObject body) {
        JSONObject data = new JSONObject();
        data.put("healthy", SystemUtil.healthy());
        data.put("load", SystemUtil.load());
        data.put("score", SystemUtil.score());
        data.put("version", RegistryApplication.version);
        return okResponse(data);
    }
}
